/**
 * @Author: ysj
 * @Date: 2019/08/24
 */

const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

/** 客户关怀 菜单路由 */
const menuRoutes = [
  /** 客户关怀 S */
  {
    path: '/customerCare',
    meta: { title: '客户关怀(售前)', icon: 'el-icon-user-solid' },
    redirect: '/customerCare',
    component: RouteView,
    children: [
      {
        path: '/customerCare/visitRules',
        meta: { title: '参数定义' },
        redirect: '/customerCare/visitRules',
        component: RouteView,
        children: [
          {
            path: '/customerCare/visitRules/questionnaireMake/index',
            meta: { title: '问卷定义', keepAlive: true },
            component: AsyncComponent('customerCare/visitRules/questionnaireMake/index')
          },
          {
            path: '/customerCare/visitRules/SMSTemplate/index',
            meta: { title: '短信模板', keepAlive: true },
            component: AsyncComponent('customerCare/visitRules/SMSTemplate/index')
          },
          {
            path: '/customerCare/visitRules/careTask/index',
            meta: { title: '关爱计划自动设置', keepAlive: true },
            component: AsyncComponent('customerCare/visitRules/careTask/index')
          },
          {
            path: '/customerCare/visitRules/manualCareTask/index',
            meta: { title: '关爱计划手工设置', keepAlive: true },
            component: AsyncComponent('customerCare/visitRules/manualCareTask/index')
          },
          {
            path: '/customerCare/visitRules/dissatisfaction/index',
            meta: { title: '不满意原因定义', keepAlive: true },
            component: AsyncComponent('customerCare/visitRules/dissatisfaction/index')
          }
        ]
      },
      {
        path: '/customerCare/saleVisit',
        meta: { title: '销售回访' },
        redirect: '/customerCare/saleVisit',
        component: RouteView,
        children: [
          {
            path: '/customerCare/saleVisit/careTaskSearch/index',
            meta: { title: '关爱任务查询', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/careTaskSearch/index')
          },
          {
            path: '/customerCare/saleVisit/salesVisit/index',
            meta: { title: '销售回访', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/salesVisit/index')
          },
          {
            path: '/customerCare/saleVisit/preSales/index',
            meta: { title: '售前回访', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/preSales/index')
          },
          {
            path: '/customerCare/saleVisit/potentialCustomerBirthday/index',
            meta: { title: '潜客生日关怀', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/potentialCustomerBirthday/index')
          },
          {
            path: '/customerCare/saleVisit/customerHoliday/index',
            meta: { title: '特殊假日关怀', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/customerHoliday/index')
          },
          {
            path: '/customerCare/saleVisit/basePlateCustomerBirthday/index',
            meta: { title: '基盘生日关怀', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/basePlateCustomerBirthday/index')
          },
          {
            path: '/customerCare/saleVisit/newCarOnDay/index',
            meta: { title: '新车当日关怀', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/newCarOnDay/index')
          },
          {
            path: '/customerCare/saleVisit/downfeedback/index',
            meta: { title: '线索战败回访', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/downfeedback/index')
          },
          {
            path: '/customerCare/saleVisit/invalidBasePlate/index',
            meta: { title: '基盘失效回访', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/invalidBasePlate/index')
          },
          {
            path: '/customerCare/saleVisit/eventInvitation/index',
            meta: { title: '活动邀约', keepAlive: true },
            component: AsyncComponent('customerCare/saleVisit/eventInvitation/index')
          }
        ]
      }
    ]
  }
  /** 客户关怀 E */
];

export default menuRoutes;
